I am tring to read a text file and for each line insert as a variable.I am new to PS and have used batch files in the past to do this . I am trying to better understand PS and would like know how best to achieve the below requirement.
I have tried various "for" statements
Example:
$variable1 = get-content d:\file.txt
$variable2 = get-content d:\files2.txt
<# the below should run for each line in the txt files #>
$user = get-spuser -identity $variable1
$user.Displayname = "$variable2"
$user.update()
Any insight is greatly appreciated
Regards,
Dennis